import { customError, post, ReturnType } from '..'
import { Settings } from '../../interface/settings'
import { URL_SETTINGS, URL_TIME } from '../base/url'

export const settings = async (): Promise<ReturnType<Settings | undefined>> => {
    try {
        const result = await post<Settings>(URL_SETTINGS)
        return result
    } catch (error: any) {
        return customError(error)
    }
}


export const serverTime = async (): Promise<ReturnType<number | undefined>> => {
    try {
        const result = await post<number>(URL_TIME)
        return result
    } catch (error: any) {
        return customError(error)
    }
}
